#include <stdio.h>
#include <conio.h>

int H2I(char x)
{
    if(x >= 'a' && x <= 'z')
         return x - 'a' + 10;    
    else if ( x >= 'A' && x <= 'Z')
       return x - 'A' + 10;   
    else if ( x >= '0' && x <= '9')
       return x - '0';   
}

int main()
{
    char c;
    FILE *fp;
    fp = fopen("Request" , "w");
    c = getch();
    while(c != 13)
    {
            char t = c;
            c = getch(); 
            unsigned char o;
            o = H2I(t) * 16 + H2I(c) ;
            fputc(o, fp);    
            printf("%2.2X ",o);  
            c = getch(); 
    }
    return 0;    
}
